#!/user/bin/env jython
# -*- coding: utf-8 -*-

from javax.swing import *
from java.awt import *
from java.lang import *


class JCostumeQueries:
	
	def __init__(self, panel):
		
		
		self.mainPanel = panel
		self.comboList = []
		self.listElementsCombo = ["Number of teachers", "Number of establishments"]
		

		
		
		
		self.makeTopPanel()
		self.addLabelToTop()
		self.addMidleGrid()
		
		print "ola"
		
		pass
		
	def makeTopPanel(self):
		
		self.topPanel = JPanel()
		self.topPanel.setPreferredSize(Dimension(800,50))
		self.topPanel.setMinimumSize(Dimension(800,50))
		self.topPanel.setMaximumSize(Dimension(800,50))
		self.topPanel.setBackground(Color.ORANGE)
		self.topPanel.layout = FlowLayout(FlowLayout.CENTER)
		self.mainPanel.add(self.topPanel)
		
	def addLabelToTop(self):
		
		topTitle = JLabel()
		topTitle.setText("Costume Queries")
		topTitle.setFont(Font("Arial", Font.BOLD, 32));
		self.topPanel.add(topTitle)
		
	def addMidleGrid(self):
		
		auxPanel1 = JPanel()
		auxPanel1.setMaximumSize(Dimension(800, 200))
		auxPanel1.setPreferredSize(Dimension(800, 100))
		self.mainPanel.add(auxPanel1)
		################################################
		midlePanel = JPanel()
		midlePanel.layout = GridLayout(0,2)
		midlePanel.setMaximumSize(Dimension(800, 100))
		
		queryTitle1 = JLabel()
		queryTitle1.setText("Procurar:")
		queryTitle1.setFont(Font("Arial", Font.BOLD, 15));
		midlePanel.add(queryTitle1)
		#################################################
		comboBox1 = JComboBox(self.listElementsCombo)
		midlePanel.add(comboBox1)
		self.comboList.append(comboBox1)
		#################################################
		queryButton1 = JButton("Add Condition")
		midlePanel.add(queryButton1)
		
		self.mainPanel.add(midlePanel)
	
	
	def onClick(self, event):
		print self.mainPanel.getHeight()
		print self.mainPanel.getWidth()
		print "########################"
